//
//  AELLicenseParticularsCell.swift
//  ActualExaminationLine
//
//  Created by iOS-Czz on 2023/10/29.
//

import UIKit

class AELLicenseParticularsCell: UITableViewCell {

    @IBOutlet var scoreLabel: UILabel!
    @IBOutlet var locationLabel: UILabel!
    @IBOutlet var nameLabel: UILabel!
    @IBOutlet var dayLabel: UILabel!
    @IBOutlet var yearLabel: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    var model: AELPointsModel? {
        didSet {
            if let dateString = self.model?.date, dateString.count >= 5 {
                let substring = String(dateString.dropFirst(5))
                self.dayLabel.text = substring
            }
            if let dateString = self.model?.date, dateString.count >= 4 {
                let substring = String(dateString.prefix(4))
                self.yearLabel.text = substring
            }
            self.nameLabel.text = self.model?.name
            self.locationLabel.text = "Location: " + self.model!.location
            self.scoreLabel.text = "-" + String(format: "%ld", self.model!.score)


        }
    }
}
